package com.xc.freeapp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.xc.freeapp.dao.TimingvisitDao;
import com.xc.freeapp.dao.dataSource.DBContextHolder;
import com.xc.freeapp.entity.Timingvisit;
import com.xc.freeapp.service.TimingvisitService;

@Service
public class TimingvisitServiceImpl implements TimingvisitService {
   
	@Autowired
	private  TimingvisitDao   timingvisitdao;
 
	public List<Timingvisit> gettimingvisit(String userid,PageBounds pageBounds) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return timingvisitdao.gettimingvisit(userid,pageBounds);
	}
 
	public int savetimingvisit(Timingvisit timingvisit) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return timingvisitdao.inserttimingvisit(timingvisit);
	}
    
	public int updatetimingvisit(Timingvisit timingvisit) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return timingvisitdao.updatetimingvisit(timingvisit);
	}
   
	public Timingvisit gettiming(int id) {
		DBContextHolder.switchDataSourceRW();//切换数据源
		return timingvisitdao.gettiming(id);
	}

	public List<Timingvisit> selectExpire() {
		DBContextHolder.switchDataSourceRW();//切换数据源
		// TODO Auto-generated method stub
		return null;
	}
	
}
